using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Project;

namespace Izhgtu.SandcastlePackage
{
	[ComVisible(true), CLSCompliant(false)]
	[Guid("97DCBB4C-40A1-4011-898C-AFB7A2A9F03B")]
	public class SandcastleFileNodeProperties : SingleFileGeneratorNodeProperties
	{
		#region ctors
        public SandcastleFileNodeProperties(HierarchyNode node)
			: base(node)
		{
		}
		#endregion

		#region properties
		[Browsable(false)]
		public string URL
		{
			get
			{
				return "file:///" + this.Node.Url;
			}
		}
		[Browsable(false)]
		public string SubType
		{
			get
			{
				return ((SandcastleFileNode)this.Node).SubType;
			}
			set
			{
                ((SandcastleFileNode)this.Node).SubType = value;
			}
		}

		[Microsoft.VisualStudio.Project.SRCategoryAttribute(Microsoft.VisualStudio.Project.SR.Advanced)]
		[Microsoft.VisualStudio.Project.LocDisplayName(Microsoft.VisualStudio.Project.SR.BuildAction)]
		[Microsoft.VisualStudio.Project.SRDescriptionAttribute(Microsoft.VisualStudio.Project.SR.BuildActionDescription)]
        public virtual SandcaslteBuildAction SandcaslteBuildAction
		{
			get
			{
				string value = this.Node.ItemNode.ItemName;
				if(value == null || value.Length == 0)
				{
                    return SandcaslteBuildAction.None;
				}
                return (SandcaslteBuildAction)Enum.Parse(typeof(SandcaslteBuildAction), value);
			}
			set
			{
				this.Node.ItemNode.ItemName = value.ToString();
			}
		}

		[Browsable(false)]
		public override BuildAction BuildAction
		{
			get
			{
                switch (this.SandcaslteBuildAction)
				{
                    case SandcaslteBuildAction.None:
						return BuildAction.None;
					default:
                        return BuildAction.None;
				}
			}
			set
			{
                this.SandcaslteBuildAction = (SandcaslteBuildAction)Enum.Parse(typeof(SandcaslteBuildAction), value.ToString());
			}
		}
		#endregion
	}

	public enum SandcaslteBuildAction { None};
}
